/*
Copyright SecureKey Technologies Inc. All Rights Reserved.

SPDX-License-Identifier: Apache-2.0
*/

package ca

import (
	"errors"

	"git.cloud.inspur.com/ichain/ichain-sdk-go/pkg/providers/iam"
)

var (
	ErrCARegistrarNotFound = errors.New("CA registrar not found")
)

type Client interface {
	Enroll(request *iam.EnrollmentRequest) error
	Reenroll(request *iam.ReenrollmentRequest) error
	Register(request *iam.RegistrationRequest) (string, error)
	Revoke(request *iam.RevocationRequest) (*iam.RevocationResponse, error)
	GetCAInfo() (*iam.GetCAInfoResponse, error)
	CreateIdentity(request *iam.IdentityRequest) (*iam.IdentityResponse, error)
	GetIdentity(id, caName string) (*iam.IdentityResponse, error)
	ModifyIdentity(request *iam.IdentityRequest) (*iam.IdentityResponse, error)
	RemoveIdentity(request *iam.RemoveIdentityRequest) (*iam.IdentityResponse, error)
	GetAllIdentities(caName string) ([]*iam.IdentityResponse, error)
	GetAffiliation(affiliation, caName string) (*iam.AffiliationResponse, error)
	GetAllAffiliations(caName string) (*iam.AffiliationResponse, error)
	AddAffiliation(request *iam.AffiliationRequest) (*iam.AffiliationResponse, error)
	ModifyAffiliation(request *iam.ModifyAffiliationRequest) (*iam.AffiliationResponse, error)
	RemoveAffiliation(request *iam.AffiliationRequest) (*iam.AffiliationResponse, error)
}
